import random

num = random.randint(1, 100)
print("产生的随机数是：", num)
time = 5
while time > 0:
    time -= 1
    a = int(input('请输入你猜的数字：'))
    if a == num:
        print('棒！你猜对了！')
        break
    elif a < num:
        print('比这个大！你还有%d次机会' % time)
    else:
        print('比这个小！你还有%d次机会' % time)
if time == 0 and a != num:
    print('这局你输了！正确的数是%d' % num)
print('计科1814-39-易芳')